﻿@model IEnumerable<B4Deal.Models.KHUYENMAI>

@{
    ViewBag.Title = "Deals";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml"; 
}
<div class="heading">
    <h1>
        Deals</h1>
    <div class="buttons">
        <a class="button" onclick="$('#form').attr('action', '#'); $('#form').attr('target', '_blank'); $('#form').submit();">
            Print Invoice</a> <a class="button" onclick= @Html.ActionLink("Insert", "CreateDeal")</a> <a class="button"
                onclick="$('#form').attr('action', '#'); $('#form').attr('target', '_self'); $('#form').submit();">
                Delete</a>
    </div>
    <!--End Buttons-->
</div>
<!--End Heading-->
<div class="content">
    <form id="form" enctype="multipart/form-data" method="post" action="" />
    <table class="list">
        <thead>
            <tr>
                <td width="1" style="text-align: center;">
                    <input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" />
                </td>
                <td class="right">
                    <a class="desc" href="#">Deal ID</a>
                </td>
                <td class="left">
                    <a href="#">Image</a>
                </td>
                <td class="center">
                    <a href="#">Deal Name</a>
                </td>
                <td class="left">
                    <a href="#">Status</a>
                </td>
                <td class="right">
                    <a href="#">Price</a>
                </td>
                <td class="left">
                    <a href="#">Date Begin</a>
                </td>
                <td class="left">
                    <a href="#">Date End</a>
                </td>
                <td class="right">
                    Action
                </td>
            </tr>
        </thead>
        <!--End thread-->
        <tbody>
            <tr class="filter">
                <td>
                </td>
                <td align="right">
                    <input type="text" style="text-align: right;" size="4" value="" name="filter_order_id" />
                </td>
                <td align="right">
                    <input type="text" style="text-align: right;" size="4" value="" name="filter_order_id" />
                </td>
                <td>
                    <input class="ui-autocomplete-input" type="text" value="" name="filter_customer"
                        autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true" />
                </td>
                <td>
                    <select name="filter_order_status_id">
                        <option value="*"></option>
                        <option value="0">Enable</option>
                        <option value="1">Disable</option>
                    </select>
                </td>
                <td align="right">
                    <input type="text" style="text-align: right;" size="4" value="" name="filter_total" />
                </td>
                <td>
                    <input id="dp1333679290142" class="date hasDatepicker" type="text" size="12" value=""
                        name="filter_date_added" />
                </td>
                <td>
                    <input id="dp1333679290143" class="date hasDatepicker" type="text" size="12" value=""
                        name="filter_date_modified" />
                </td>
                <td align="right">
                    <a class="button" onclick="filter();">Filter</a>
                </td>
            </tr>
            <!--End fillter-->
            <!------Data----------------------------->
            @foreach (var item in Model)
            {
                <tr>
                    <td style="text-align: center;">
                                            <input type="checkbox" value="1288" name="selected[]"/>
                    </td>
                    <td class="right">
                        @Html.DisplayFor(modelItem => item.MaKM)
                    </td>
                    <td class="center">
                        <img style="padding: 1px; border: 1px solid #DDDDDD;" width="80" height="80" src="../../Content/Layout/Images/deals/@item.HinhAnh" alt="@item.TenKM" title="@item.TenKM">
                  
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.TenKM)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.TinhTrang)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.DonGiaMoi)
                    </td>
                    <td class="left">
                        @Html.DisplayFor(modelItem => item.BatDauKM)
                    </td>
                    <td class="left">
                        @Html.DisplayFor(modelItem => item.KetThucKM)
                    </td>
                    <td class="left">
                       @Html.ActionLink("[View]", "DealDetails", new { id = item.MaKM }) |
                        @Html.ActionLink("[Edit]", "DealEdit", new { id = item.MaKM }) 
                          @Html.ActionLink("[Delete]", "DeleteDeal", new { id = item.MaKM })       
                    </td>
                </tr>
            } 
    </table>
    <!--End Table-->
    </form><!--End form-->
    <div class="pagination">
        <div class="links">
            <b>1</b> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a href="#">5</a>
            <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">
                10</a> <a href="#">11</a> .... <a href="#">&gt;</a> <a href="#">&gt;|</a>
        </div>
        <div class="results">
            Showing 1 to 20 of 967 (49 Pages)</div>
    </div>
</div>
<!--End content-->
